<html>
<head>
<meta name="Generator" content="QQ 80342014" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="Keywords" content="<?php echo $this->_var['keywords']; ?>" />
<meta name="Description" content="<?php echo $this->_var['description']; ?>" />

<title><?php echo $this->_var['page_title']; ?></title>

<link rel="shortcut icon" href="favicon.ico" />
<link rel="icon" href="animated_favicon.gif" type="image/gif" />
<link href="<?php echo $this->_var['ecs_css_path']; ?>" rel="stylesheet" type="text/css" />

<?php echo $this->smarty_insert_scripts(array('files'=>'transport_jquery.js,common.js,user.js')); ?>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta name="format-detection" content="telephone=no" />

<meta name="full-screen" content="yes">

<meta name="x5-fullscreen" content="true">
</head>
<body>
<?php echo $this->fetch('library/header.lbi'); ?>

<div class="y-navn">
	<div id="y-navs">
		<ul>
			<a href="article_cat.php"><li <?php if ($this->_var['cat_id'] < 0): ?> class="select1"<?php endif; ?>>全部</li></a>
			<?php $_from = $this->_var['article_cat']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'item');if (count($_from)):
    foreach ($_from AS $this->_var['item']):
?>
			<a href="<?php echo $this->_var['item']['url']; ?>"><li <?php if ($this->_var['cat_id'] == $this->_var['item']['cat_id']): ?> class="select1"<?php endif; ?>><?php echo $this->_var['item']['cat_name']; ?></li></a>
			<?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
		</ul>
	</div>
</div>
<div class="clear"></div>


<div id="wk-content">
	<div class="y-new" style="display:block">	
	</div>
</div>

<div class="wk-height"></div>
<link href="themes/view/css/dropload.css" rel="stylesheet" type="text/css" />

<script type="text/javascript" src="themes/view/js/dropload.min.js"></script>
<script>
$(function(){
   	  // 每页展示4个
		var cat_id = <?php echo $this->_var['cat_id']; ?>;
		var size = 10;
		var page = 1;
 
    // dropload
    $('#wk-content').dropload({
        scrollArea : window,
        loadDownFn : function(me){ 
			var user = {
				id:cat_id,
				page:page,
				size:size,
			}; 
            $.ajax({
                type: 'GET',
				data:user,
				url: 'article_cat.php?act=ajaxlist', 
                dataType: 'json',
                success: function(result){ 
				 
                    var str = ''; 
                    page = page + 1;	  /* 下一页  */
					lengths = result.lengths; /* 数组的长度 */
					lists = result.list;
					for(var i = 0; i < lengths; i++){ 
						str +=	'<a href="'+ lists[i].url +'">'
							+'<div class="y-news">'
							+	'<div class="y-images">'
							+		'<img src="'+ lists[i].file_url +'" />'
							+	'</div>'
							+	'<div class="y-text">'
							+		'<p>'+ lists[i].short_title +'</p>'
							+		'<div class="y-new-con">'+ lists[i].description +'</div>'
							+	'</div>'
						+	'</div>'
						+' </a>'; 
                    }
				
					if(!lengths){
						// 锁定
						me.lock();
						// 无数据
						me.noData();
					}
                    // 为了测试，延迟1秒加载
                    setTimeout(function(){
                        $('.y-new').append(str);
                        // 每次数据加载完，必须重置
                        me.resetload();
                    },1000);
                },
                error: function(xhr, type){
                    
                    // 即使加载出错，也得重置
                    me.resetload();
                }
            });
        }
    });
});
</script>
<?php echo $this->fetch('library/foot.lbi'); ?>


</body>
</html>